FROM zhilink/ubuntu:14.04.1_v01
#FROM 172.31.75.188/zhilink/ubuntu:14.04.1_v01

ADD redis-3.0.7.tar.gz / 
ADD nutcracker-0.3.0.tar.gz  /

#安装更新依赖
RUN apt-get update -y \
&& apt-get install gcc make -y 

#安装redis
RUN mv  redis-3.0.7  /usr/local/redis \
    && cd  /usr/local/redis \
    && make MALLOC=libc && make  install \
    && mkdir /usr/local/redis/etc && mkdir /usr/local/redis/data && mkdir /usr/local/redis/logs

#安装twemproxy
RUN cd  nutcracker-0.3.0 \
&& ./configure  --prefix=/usr/local/nutcracker \
&& make && make install \
&& cd /usr/local/nutcracker \
&& mkdir etc run log \
&& cd / && rm -rf nutcracker-0.3.0 \
&& cp /usr/share/zoneinfo/Asia/Shanghai   /etc/localtime


#配置文件
COPY redis.conf /usr/local/redis/etc/redis.conf 
COPY nutcracker.yml /usr/local/nutcracker/etc/nutcracker.yml
COPY start.sh /start.sh



EXPOSE 6379 22121 


CMD ["/start.sh"]

